package com.lagou.sqlSession;

import com.lagou.config.XmlConfigBuilder;
import com.lagou.pojo.Configuration;
import org.dom4j.DocumentException;

import java.beans.PropertyVetoException;
import java.io.InputStream;

public class SqlSessionFactoryBuilder {
    public  SqlSessionFactory build(InputStream in) throws PropertyVetoException, DocumentException {
        XmlConfigBuilder xmlConfigBuilder =new XmlConfigBuilder();
        Configuration configuration = xmlConfigBuilder.parseConfig(in);

        DefaultSqlSessionFactory defaultSqlSessionFactory =new DefaultSqlSessionFactory(configuration);
        System.out.println("2222222222222222222222");

        return defaultSqlSessionFactory;
    }
}
